#include<iostream>
#include "../../myrpc/RpcChannel.h"
#include "../../myrpc/myrpccontroller.h"
#include "../../myrpc/myrpc.pb.h"
#include "ping.pb.h"
#include "../../include/google/protobuf/stubs/callback.h"

class MyServer : public myrpc::PingService
{
public:
	virtual void Ping(::google::protobuf::RpcController* controller,
		const ::myrpc::PingRequest* request,
		::myrpc::PingResponse* response,
		::google::protobuf::Closure* done)
	{
		response->set_result("Hello World");
	}
};




int main()
{	
	myrpc::RpcChannel channel;
	MyServer* myserver = new MyServer;
	channel.RegisterService(myserver);
	channel.Start("127.0.0.1" , 18888);
	return 0;
}